//
//  DrawCode.m
//  CPICMobileServiceApp
//
//  Created by sinosoft on 13-3-3.
//  Copyright (c) 2013年 lizhiwei. All rights reserved.
//

#import "DrawCode.h"

@implementation DrawCode

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        // Initialization code
    }
    return self;
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect
{
    // Drawing code
}
*/

-(void)sharePoints:(NSMutableArray *)arrayPoint;
{
    Array=arrayPoint;
}
-(void)drawRect : (CGRect)rect
{
    CGContextRef context = UIGraphicsGetCurrentContext();
    CGContextSetLineWidth(context, 2.0);
    
    CGContextSetStrokeColorWithColor(context, [[UIColor blackColor]CGColor]);
    for(int cout = 0; cout <Array.count ; cout++)
    {
        CGPoint point1 =  [[Array objectAtIndex:cout]CGPointValue];
        CGPoint point2 = [[Array objectAtIndex:cout+1]CGPointValue];
        CGContextMoveToPoint(context, point1.x, point1.y);
        CGContextAddLineToPoint(context,point2.x,point2.y);
        CGContextStrokePath(context);
        cout ++;
        
    }
    
}


@end
